package com.tjshop.android.model;

import java.util.ArrayList;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

public class Category {
	private String id;
	private String title;

	private ArrayList<keyPair> sublist = new ArrayList<keyPair>();

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public ArrayList<keyPair> getSublist() {
		return sublist;
	}

	public void addSubCatagory(ArrayList<keyPair> sublist) {
		this.sublist = sublist;
	}

	public void parse(JSONObject category) {
		try {
			setId(category.getString("cat_id"));
			setTitle(category.getString("cat_name"));
		} catch (JSONException e) {
			e.printStackTrace();
		}

	}

}
